<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // number,string,boolean
        // 强制转换
        // string,boolean --> number  Number(value)
        // string --> number 只能识别纯数字的字符串
        var str = "10";
        var s = "hello world"
        var z = "2121sgd"
        var num = Number(str)
        console.log(num)
        console.log(Number(s))  //NaN 不是一个数字
        console.log(Number(z))
    </script>
</body>
</html>